<!DOCTYPE html>
<html>

    <head>
        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>主题管理</title>
        <link rel="stylesheet" href="css/reset.css" />
        <link rel="stylesheet" href="css/platform.css" />
        <link rel="stylesheet" href="css/cropper.css" />
        <link rel="stylesheet" href="css/cropper-demo.css" />
        <link rel="stylesheet" href="js/ui/jquery-ui.min.css" />
        <link rel="stylesheet" href="css/table.css" />
        <link rel="stylesheet" href="css/topic.css" />
    </head>

    <body>
        <div class="header">
            <div class="u-title">主题管理</div>
        </div>
        <!-- 页面内容展示区域 -->
        <div class="container" ms-controller="mainController">
            <div class="u-multiform" style="overflow: hidden;">
                <div class="column">
                    <div class="cell">
                        <label>主题筛选：</label>
                        <div class="cnt-box">
                            <div class="combox">
                                <input class="u-ipt" ms-duplex="topicKey" />
                            </div>
                        </div>
                    </div>
                </div>
                <div class="column btn-box">
                    <div class="cell">
                        <label></label>
                        <div class="cnt-box">
                            <button class="u-btn small" ms-click="searchData">查询</button>
                        </div>
                    </div>
                </div>
                <button class="u-btn small" style="float: right;" ms-click="add()">新增</button>
            </div>

            <div id="topicTable" ms-controller="topicTable"></div>
            <script type="avalon" id="tabletopic">
                <div class="tableWrapper">
                    <table class="table">
                        <thead>
                            <tr>
                                <th>缩略图</th>
                                <th>主题名称</th>
                                <th>正方人数</th>
                                <th>反方人数</th>
                                <th>正方评论数</th>
                                <th>反方评论数</th>
                                <th>定义结束时间</th>
                                <th>定义是否词</th>
                                <th class="operate">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr ms-repeat-row="sources">
                                <td>
                                    <img ms-attr-src="row.topicImg" style="width: 60px; height: 60px;" />
                                </td>
                                <td>{{row.topicName}}</td>
                                <td>{{row.supNum}}</td>
                                <td>{{row.rejNum}}</td>
                                <td>{{row.supCommNum}}</td>
                                <td>{{row.rejCommNum}}</td>
                                <td>{{row.endTime}}</td>
                                <td>{{row.supViewTip}},{{row.rejViewTip}}</td>
                                <td class="operate">
                                    <a href="javascript:;" ms-click="customFuncs.modifyPop(row)">修改</a>
                                    <a href="javascript:;" ms-click="customFuncs.viewTopic(row.topicId)">预览</a>
                                    <a href="javascript:;" ms-click="customFuncs.delPop(row.topicId)">删除</a>
                                </td>
                            </tr>
                        </tbody>
                        <tfoot>
                            <tr>
                                <td colspan="9">
                                    <div class="pager">
                                        <div class="first-page" ms-click="firstpage" ms-class={{firstpagestyle}}>首页</div>
                                        <div class="pre-page" ms-click="prepage" ms-class={{prepagestyle}}>上一页</div>
                                        <div class="current-page">
                                            第<input class="current-page-num" type="text" ms-duplex="currentpage" ms-input="jumppage" />页
                                            <span class="totalpage">共 {{totalpage}} 页</span>
                                        </div>
                                        <div class="next-page" ms-click="nextpage" ms-class={{nextpagestyle}}>下一页</div>
                                        <div class="last-page" ms-click="lastpage" ms-class={{lastpagestyle}}>尾页</div>
                                        <div class="messageinfo">{{startrow}}-{{endrow}} 共{{total}}条</div>
                                    </div>
                                </td>
                            </tr>
                        </tfoot>
                    </table>
                </div>
            </script>

        </div>
        <!--弹框区域-->
        <div ms-controller="popController">
            <div class="u-popup" id="popup_confirm">
                <div class="bg"></div>
                <div class="asTable">
                    <div class="asTableCell">
                        <div class="asCell alert">
                            <a href="javascript:;" class="close btn-close">×</a>
                            <p class="title">提示</p>
                            <div class="container">
                                <div class="warning"></div>
                                <p ms-if="confirmType=='del'">确定要删除该话题吗？</p>
                            </div>
                            <div class="btn-box">
                                <button ms-if="confirmType=='del'" class="u-btn" ms-click="delTopic()">确定</button>
                                <button class="u-btn gray btn-close">取消</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="u-popup" id="popup_tips">
                <div class="bg"></div>
                <div class="asTable">
                    <div class="asTableCell">
                        <div class="asCell alert">
                            <a href="javascript:;" class="close btn-close">×</a>
                            <p class="title">提示</p>
                            <div class="container">
                                <div class="error"></div>
                                <p></p>
                            </div>
                            <div class="btn-box">
                                <button class="u-btn btn-close">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="u-popup" id="popup_cnt">
                <div class="bg"></div>
                <div class="asTable-box">
                    <div class="asTable">
                        <div class="asTableCell">
                            <div class="asCell dialog">
                                <p class="top-err"></p>
                                <a href="javascript:;" class="close btn-close">×</a>
                                <p class="title">新增主题</p>
                                <!--<form id="form_saveTopic" enctype="multipart/form-data" method="post">-->
                                <div class="container">
                                    <div class="u-form">
                                        <div class="column">
                                            <label><span>*</span>话题主题：</label>
                                            <input name="bizcode" ms-duplex="topicName" class="u-ipt" type="text" maxlength="100" />
                                        </div>
                                        <div class="column">
                                            <label><span>*</span>话题结束时间：</label>
                                            <input class="u-ipt ipt-timepicker" type="text" id="endTime" ms-duplex="endTime" />
                                        </div>
                                        <div class="column">
                                            <label><span>*</span>定义是否词:</label>
                                            <div class="cnt-box words">
                                                <p>
                                                    <!--<span>是:</span>-->
                                                    <input class="u-ipt" type="text" ms-duplex="supViewTip" placeholder="是" />
                                                </p>
                                                <p>
                                                    <!--<span>否:</span>-->
                                                    <input class="u-ipt" type="text" ms-duplex="rejViewTip" placeholder="否" />
                                                </p>
                                            </div>
                                        </div>
                                        <div class="column">
                                            <label><span>*</span>图片：</label>
                                            <div class="cnt-box">
                                                <!--<form id="form_uploadImg" enctype="multipart/form-data" method="post">-->
                                                    <div class="upload-img">
                                                        <p class="as-btn">选择上传文件</p>
                                                        <input type="file" name="image" id="cropper-input" accept="image/jpeg,image/x-png">
                                                    </div>
                                                    <div class="preview-container" ms-visible="isAdd">
                                                        <input type="hidden" name="x" id="preview-x" />
                                                        <input type="hidden" name="y" id="preview-y" />
                                                        <input type="hidden" name="width" id="preview-width" />
                                                        <input type="hidden" name="height" id="preview-height" />
                                                        <div class="image-container target" id="cropper-target">
                                                            <img src="" class="noavatar" />
                                                        </div>
                                                        <div class="large-wrapper">
                                                            <div class="image-container large" id="preview-large">
                                                                <div class="image-wrapper">
                                                                    <img src="" class="noavatar" />
                                                                </div>
                                                            </div>
                                                            <button ms-click="uploadImg" class="u-btn small">上传图片</button>
                                                            <!--<button ms-visible="canceluploadImg" ms-click="cancelUploadImg" class="u-btn small" style="margin-left: 10px;">取消修改</button>-->
                                                        </div>
                                                    </div>
                                                    <div ms-visible="!isAdd && modify">
                                                        <img ms-attr-src="imgUrl" style="width: 200px; height: 200px;" />
                                                    </div>
                                                <!--</form>-->
                                            </div>
                                        </div>

                                    </div>
                                </div>
                                <!--</form>-->
                                <div class="btn-box">
                                    <button class="u-btn" ms-click="save">保存</button>
                                    <button class="u-btn gray btn-close">取消</button>
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script src="js/jquery.min.js"></script>
        <script src="js/jquery.form.js"></script>
        <script src="js/avalon.shim.sn.js"></script>
        <script src="js/ui/jquery-ui.min.js"></script>
        <script src="js/ui/jquery-ui-timepicker-addon.js"></script>
        <script src="js/platform.js"></script>
        <script src="js/swift-ui-table-1.1.js"></script>
        <script src="js/cropper.js"></script>
        <script src="js/DataInterface/DataInterface.js"></script>
        <script src="js/topicmanage.js"></script>
    </body>

</html>
